<? include "./install/view/header.inc.htm"; ?>

<h3>三、检测 URL-Rewrite</h3>
<p>URL-Rewrite 对 SEO 非常重要，需要您花一点耐心配置下您的 Web Server 的 URL-Rewrite</p>
<p>Xiuno 对 url-rewrite 的要求很简单：将所有的 *.htm 转发到 index.php?*.htm 即可</p>
<p>帮助文档：<a href="http://bbs.xiuno.com/thread-8768.htm" target="_blank"><b>如何设置 Xiuno BBS URL-Rewrite</b></a></p>
<form id="form" action="index.php?0=step4">
	<div class="list">
		<table class="panel tborder" width="100%">
			<tr align="center">
				<th align="left"><b>网站运行环境检测</b></th>
				<th>要求</th>
				<th>当前</th>
				<th>检测结果</th>
			</tr>
			<tr>
				<td>Web-Server</td>
				<td align="center">无</td>
				<td align="center"><?=$webserver?></td>
				<td align="center">
					<div class="ok"><b class="icon check green"></b>通过</div>
				</td>
			</tr>
			<tr id="urlrewrite">
				<td>URL-Rewrite</td>
				<td align="center">配置正确</td>
				<td align="center">配置正确/不正确</td>
				<td align="center">
					<div class="ok"><b class="icon check green"></b>通过</div>
					<div class="error"><b class="icon close red"></b>未通过</div>
				</td>
			</tr>
		</table>
	</div>
	<p class="center margin">
		<button type="button" class="blue big" onclick="history.back();">上一步</button>
		<button type="submit" class="blue big" id="submit" loading-text="正在检测..." >下一步</button>
	</p>
</form>
<? include "./install/view/footer.inc.htm"; ?>

<script>
var jform = $('#form');
var jsubmit = $('#submit');
jform.on('submit', function(code, message) {
	$.xget('../index.htm', function(code, message) {
		if(message.indexOf('xiunoui/xiuno.css') != -1) {
			window.location='index.php?0=step4';
		} else {
			$.alert('检测 URL-Rewrite 未配置成功，请参照文档提示进行配置。');
		}
	});
	return false;
});
var jurlrewrite = $('#urlrewrite');
$.xget('../index.htm', function(code, message) {
	if(message.indexOf('xiunoui/xiuno.css') != -1) {
		jurlrewrite.find('td').eq(2).text('配置正确');
		jurlrewrite.find('td').eq(3).html('<div class="ok"><b class="icon check green"></b>通过</div>');
	} else {
		jurlrewrite.find('td').eq(2).html('<a href="http://bbs.xiuno.com/thread-8768.htm" target="_blank"><b>配置错误</b></a>');
		jurlrewrite.find('td').eq(3).html('<div class="error"><b class="icon close red"></b>未通过</div>');
	}
});

</script>